<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>canvas绘制矩形方法二</title>
	</head>
	<body>
		<canvas id="canv" width="500" height="500" style="border:solid 2px red;">
			当前浏览器不支持canvas
		</canvas>		
		<script>
			var oC=document.getElementById("canv");
			var ctx=oC.getContext("2d");
			//绘制矩形的方法rect（x,y,w,h）
			ctx.rect(100,100,200,100);
			ctx.stroke();
		</script>	
	</body>
</html>
